home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / system / ffg202.zip / UTIL_BAT.ZIP / SAVECFGS.BAT < prev    next >
DOS Batch File  |  1995-04-01  |  2KB  |  48 lines

  1. @echo off
  2. ::
  3. :: Makes archive backups of your system configuration files for each drive.
  4. ::
  5. :: For each disk drive on your system (actually only for drive letters that
  6. :: appear in the list below in the 'for' statement), batch file makes an
  7. :: archive file of all config files on that drive.
  8. ::
  9. :: - It requires the free LHA archiving utility.
  10. :: - The file CFGFILTR.FFG must exist in the current directory.
  11. ::   CFGFILTR.FFG has all the FFG options to search for config files.
  12. :: - It makes directory C:\CONFIG to hold the config file archives
  13. ::
  14. :: - PKZIP would also work except it has problems handling large list files and
  15. ::   results in out-of-memory errors if the list file is bigger than a few K.
  16. ::
  17. if "%1"=="DO_DRIVE" goto DO_DRIVE
  18.   if not exist c:\config\nul md c:\config
  19.   :: Get CFGFILTR.FFG in the right place:
  20.   if not exist CFGFILTR.FFG goto END
  21.   if     exist c:\config\nul copy CFGFILTR.FFG c:\config
  22.   ::
  23.   :: Put your drive letters in the following list in parenthesis:
  24.   ::
  25.   for %%f in (c d e f) do if exist %%f:\nul call %0 DO_DRIVE %%f
  26.   goto END
  27. ::-----------------------------------------------------------------------------
  28. :DO_DRIVE
  29. ::
  30. :: This section does the individual drive stuff, where %2 is the drive letter:
  31. ::
  32.   if "%2"=="" goto END
  33.     %2:
  34.     echo Searching for configuration files on drive %2: to put in list "cfglst.%2"
  35.     ffg < c:\config\cfgfiltr.ffg > c:\config\cfglst.%2
  36.     ::
  37.     :: Here we use LHA to do the archiving:
  38.     ::
  39.     echo Archiving configuration files listed in "cfglst.%2" for drive %2:
  40.     lha u /p /a /x c:\config\cfgdrv_%2 @c:\config\cfglst.%2
  41. ::
  42. :: Could have used PKZIP if it didn't run out of memory with large ZIP lists:
  43. ::
  44. ::    if not "%3"=="ZIP" if not "%3"=="zip" goto NO_ZIP
  45. ::      echo Archiving configuration files listed in "cfglst.%2" for drive %2:
  46. ::      pkzip -P c:\config\cfgdrv_%2 @c:\config\cfglst.%2
  47. :END
  48.